home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / RemoteMailCompose / MailSpeaker.m < prev    next >
Text File  |  1995-06-12  |  4KB  |  110 lines

  1. //----------------------------------------------------------------------------------------------------
  2. //
  3. //    MailSpeaker
  4. //
  5. //    Inherits From:        Speaker
  6. //
  7. //    Declared In:        MailSpeaker.h
  8. //
  9. //    Disclaimer
  10. //
  11. //        You may freely copy, distribute and reuse this software and its
  12. //        associated documentation. I disclaim any warranty of any kind, 
  13. //        expressed or implied, as to its fitness for any particular use.
  14. //
  15. //----------------------------------------------------------------------------------------------------
  16. #import <appkit/appkit.h>
  17. #import "MailSpeaker.h"
  18. #import <mach/mach.h>
  19. #import <mach/message.h>
  20. #import <servers/netname.h>
  21.  
  22. extern port_t name_server_port;
  23. extern id NXResponsibleDelegate();
  24.  
  25.  
  26. @implementation  MailSpeaker
  27.  
  28. //----------------------------------------------------------------------------------------------------
  29. //  Compose Methods (window not specified)
  30. //----------------------------------------------------------------------------------------------------
  31. - (int) deliver
  32. {
  33.     //  Deliver the compose window opened by 'openSend'.
  34.     return [self selectorRPC:"deliver" paramTypes:""];
  35. }
  36.  
  37. - (int) openSend
  38. {
  39.     //  Open a compose window in Mail.app.
  40.     return [self selectorRPC:"openSend" paramTypes:""];
  41. }
  42.  
  43. - (int) setBody : (char *) aString
  44. {
  45.     //  Set the letter 'body' for the compose window opened by 'openSend' to aString.
  46.     return [self selectorRPC:"setBody:" paramTypes:"c", aString];
  47. }
  48.  
  49. - (int) setCc : (char *) aString
  50. {
  51.     //  Set the 'Cc:' field for the compose window opened by 'openSend' to aString.
  52.     return [self selectorRPC:"setCc:" paramTypes:"c", aString];
  53. }
  54.  
  55. - (int) setSubject : (char *) aString
  56. {
  57.     //  Set the 'Subject:' field for the compose window opened by 'openSend' to aString.
  58.     return [self selectorRPC:"setSubject:" paramTypes:"c", aString];
  59. }
  60.  
  61. - (int) setTo : (char *) aString
  62. {
  63.     //  Set the 'To:' field for the compose window opened by 'openSend' to aString.
  64.     return [self selectorRPC:"setTo:" paramTypes:"c", aString];
  65. }
  66.  
  67.  
  68. //----------------------------------------------------------------------------------------------------
  69. //  Compose Methods (window specified) 
  70. //----------------------------------------------------------------------------------------------------
  71. - (int) deliver : (int) aWindow
  72. {
  73.     //  Deliver the window specified by aWindow (returned in openSend: ).
  74.     return [self selectorRPC:"deliver:" paramTypes:"i", aWindow];
  75. }
  76.  
  77. - (int) openSend : (int *) aWindow
  78. {
  79.     //  Open a compose window in Mail.app and returns the window number
  80.     //  by reference in aWindow.  This is the unique identifier for this window
  81.     //  and is used as the argument in methods that take a window parameter.
  82.     return [self selectorRPC:"openSend:" paramTypes:"I", aWindow];
  83. }
  84.  
  85. - (int) setBody : (char *) aString inWindow : (int) aWindow
  86. {
  87.     //  Set the letter body to aString for compose window aWindow.
  88.     return [self selectorRPC:"setBody:inWindow:" paramTypes:"ci", aString, aWindow];
  89. }
  90.  
  91. - (int) setCc : (char *) aString inWindow : (int) aWindow
  92. {
  93.     //  Set the 'Cc:' field to aString for compose window aWindow.
  94.     return [self selectorRPC:"setCc:inWindow:" paramTypes:"ci", aString, aWindow];
  95. }
  96.  
  97. - (int) setSubject : (char *) aString inWindow : (int) aWindow
  98. {
  99.     //  Set the 'Subject:' field to aString for compose window aWindow.
  100.     return [self selectorRPC:"setSubject:inWindow:" paramTypes:"ci", aString, aWindow];
  101. }
  102.  
  103. - (int) setTo : (char *) aString inWindow : (int) aWindow
  104. {
  105.     //  Set the 'To:' field to aString for compose window aWindow.
  106.     return [self selectorRPC:"setTo:inWindow:" paramTypes:"ci", aString, aWindow];
  107. }
  108.  
  109. @end
  110.